package cn.edkuir.order;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 *  RabbitMQ
 *  1.引入amqp场景, RabbitAutoConfiguration 生效
 *  2.给容器中自动配置了 RabbitTemplate、AmqpAdmin、RabbitMessagingTemplate、CachingConnectionFactory
 *  3.@EnableXXX
 *  4.配置文件 RabbitProperties prefix = "spring.rabbitmq"
 *  5.监听消息: 1) @RabbitListener 标在类或方法上
 *      2) @RabbitHandler: 标在方法上 => 重载区分不同的消息
 *
 *
 *  Seata
 *  1.每个微服务创建undo_log表
 *  2.安装事务协调器 TC: seata-server
 *  3.修改registry.conf注册中心、配置中心的配置
 *  4.所有想要用到分布式事务的微服务使用seata数据源代理
 *  5.每个微服务都必须导入register.conf、file.conf配置文件
 *  6.分布式大事务的入口标 @GlobalTransactional
 */
@EnableFeignClients
@EnableRedisHttpSession
@EnableRabbit
@SpringBootApplication
@EnableDiscoveryClient
@MapperScan("cn.edkuir.order.dao")
public class MallOrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(MallOrderApplication.class, args);
    }

}
